package com.yksj.healthtalk.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

/**
 * 药品推荐实体
 * @author root
 *
 */
public class RecommendationEntity implements Serializable {
	private String GoodsID;//商品ID
	private String GoodsName;//商品名称
	private String GOODS_MERCHANT_ID;//商品商户ID
	private String TIME;//时间
	private String MERCHANT_NAME;// 商户名称
	private String VIP_PRICE;// 商品价格
	private String SPECIFICATIONS;// 规格
	private String PICTURE_ADDR;// 图片地址
	private String BUYCOUNT;//共几件商品
	private String GOODS_TOTAL;//商品推荐总额
	
	
	public String getGOODS_TOTAL() {
		return GOODS_TOTAL;
	}

	public void setGOODS_TOTAL(String gOODS_TOTAL) {
		GOODS_TOTAL = gOODS_TOTAL;
	}

	public String getBUYCOUNT() {
		return BUYCOUNT;
	}

	public void setBUYCOUNT(String bUYCOUNT) {
		BUYCOUNT = bUYCOUNT;
	}

	public RecommendationEntity() {
	}

	public String getGoodsID() {
		return GoodsID;
	}
	public void setGoodsID(String goodsID) {
		GoodsID = goodsID;
	}
	public String getGoodsName() {
		return GoodsName;
	}
	public void setGoodsName(String goodsName) {
		GoodsName = goodsName;
	}
	public String getGOODS_MERCHANT_ID() {
		return GOODS_MERCHANT_ID;
	}
	public void setGOODS_MERCHANT_ID(String gOODS_MERCHANT_ID) {
		GOODS_MERCHANT_ID = gOODS_MERCHANT_ID;
	}
	public String getTIME() {
		return TIME;
	}
	public void setTIME(String tIME) {
		TIME = tIME;
	}
	public String getMERCHANT_NAME() {
		return MERCHANT_NAME;
	}
	public void setMERCHANT_NAME(String mERCHANT_NAME) {
		MERCHANT_NAME = mERCHANT_NAME;
	}
	public String getVIP_PRICE() {
		return VIP_PRICE;
	}
	public void setVIP_PRICE(String vIP_PRICE) {
		VIP_PRICE = vIP_PRICE;
	}
	public String getSPECIFICATIONS() {
		return SPECIFICATIONS;
	}
	public void setSPECIFICATIONS(String sPECIFICATIONS) {
		SPECIFICATIONS = sPECIFICATIONS;
	}
	public String getPICTURE_ADDR() {
		return PICTURE_ADDR;
	}
	public void setPICTURE_ADDR(String pICTURE_ADDR) {
		PICTURE_ADDR = pICTURE_ADDR;
	}
	//
	public static List<RecommendationEntity> paseToList(String object){
		List<RecommendationEntity> entities=null;
		try {
			 JSONArray obj=new JSONArray(object);
			 entities=new ArrayList<RecommendationEntity>();
			 for (int i = 0; i < obj.length(); i++) {
				 RecommendationEntity entitie=new RecommendationEntity();
				 JSONObject object2 = (JSONObject)obj.get(i);
				 entitie.setGoodsID(object2.getString("GOODS_ID"));
				 entitie.setGoodsName(object2.getString("GOODS_NAME"));
				 entitie.setGOODS_MERCHANT_ID(object2.getString("GOODS_MERCHANT_ID"));
				 entitie.setMERCHANT_NAME(object2.getString("MERCHANT_NAME"));
				 entitie.setPICTURE_ADDR(object2.getString("PICTURE_ADDR"));
				 entitie.setTIME(object2.getString("TIME"));
				 entitie.setVIP_PRICE(object2.getString("VIP_PRICE"));
				 entitie.setSPECIFICATIONS(object2.getString("SPECIFICATIONS"));
				 entitie.setBUYCOUNT(object2.getString("BUYCOUNT"));
				 entitie.setGOODS_TOTAL(object2.getString("GOODS_TOTAL"));
				 entities.add(entitie);
				 }
			 return entities;
		} catch (Exception e) {
			return null;
		}
	}
}
